package gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class CursadasExaminar extends JFrame {

	private JPanel contentPane;
	private JTextField textField;
	private JTextField textField_1;
	private JTextField textField_2;
	private JLabel lblCodigo;
	private JLabel lblCursoDictado;
	private JLabel lblInstructor;
	private JLabel lblDiasYHorarios;
	private JLabel lblLunes;
	private JLabel lblMartes;
	private JLabel lblMiercoles;
	private JLabel lblJueves;
	private JLabel lblViernes;
	private JLabel lblSabado;
	private JLabel lblDomingo;
	private JLabel lblInscriptos;
	private JTextField textField_3;
	private JTextField textField_4;
	private JTextField textField_5;
	private JTextField textField_6;
	private JTextField textField_7;
	private JTextField textField_8;
	private JTextField textField_9;
	
	private JTable table;
	private JScrollPane scrollPane;

	/**
	 * Launch the application.
	 */
	/*public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					CursadasExaminar frame = new CursadasExaminar();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public CursadasExaminar(Cursadas padre) {
		setTitle("Examinar Cursada");
		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e){
				padre.nullCursadasExaminar();
			}
		});
		setTitle("Examinar Cursada");
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 360, 645);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		lblCodigo = new JLabel("Codigo:");
		lblCodigo.setBounds(10, 11, 86, 14);
		contentPane.add(lblCodigo);
		
		textField = new JTextField();
		textField.setEditable(false);
		textField.setBounds(100, 8, 86, 20);
		contentPane.add(textField);
		textField.setColumns(10);
		
		lblCursoDictado = new JLabel("Curso Dictado:");
		lblCursoDictado.setBounds(10, 34, 86, 14);
		contentPane.add(lblCursoDictado);
		
		textField_1 = new JTextField();
		textField_1.setEditable(false);
		textField_1.setColumns(10);
		textField_1.setBounds(100, 31, 86, 20);
		contentPane.add(textField_1);
		
		textField_2 = new JTextField();
		textField_2.setEditable(false);
		textField_2.setColumns(10);
		textField_2.setBounds(100, 55, 86, 20);
		contentPane.add(textField_2);
		
		lblInstructor = new JLabel("Instructor:");
		lblInstructor.setBounds(10, 58, 86, 14);
		contentPane.add(lblInstructor);
		
		lblDiasYHorarios = new JLabel("Dias y Horarios de la Cursada");
		lblDiasYHorarios.setBounds(10, 86, 176, 14);
		contentPane.add(lblDiasYHorarios);
		
		lblLunes = new JLabel("Lunes:");
		lblLunes.setBounds(10, 111, 86, 14);
		contentPane.add(lblLunes);
		
		lblMartes = new JLabel("Martes:");
		lblMartes.setBounds(10, 136, 86, 14);
		contentPane.add(lblMartes);
		
		lblMiercoles = new JLabel("Miercoles:");
		lblMiercoles.setBounds(10, 160, 86, 14);
		contentPane.add(lblMiercoles);
		
		lblJueves = new JLabel("Jueves:");
		lblJueves.setBounds(10, 184, 86, 14);
		contentPane.add(lblJueves);
		
		lblViernes = new JLabel("Viernes:");
		lblViernes.setBounds(10, 208, 86, 14);
		contentPane.add(lblViernes);
		
		lblSabado = new JLabel("Sabado:");
		lblSabado.setBounds(10, 233, 86, 14);
		contentPane.add(lblSabado);
		
		lblDomingo = new JLabel("Domingo:");
		lblDomingo.setBounds(10, 257, 86, 14);
		contentPane.add(lblDomingo);
		
		textField_3 = new JTextField();
		textField_3.setEditable(false);
		textField_3.setColumns(10);
		textField_3.setBounds(100, 108, 86, 20);
		contentPane.add(textField_3);
		
		textField_4 = new JTextField();
		textField_4.setEditable(false);
		textField_4.setColumns(10);
		textField_4.setBounds(100, 133, 86, 20);
		contentPane.add(textField_4);
		
		textField_5 = new JTextField();
		textField_5.setEditable(false);
		textField_5.setColumns(10);
		textField_5.setBounds(100, 157, 86, 20);
		contentPane.add(textField_5);
		
		textField_6 = new JTextField();
		textField_6.setEditable(false);
		textField_6.setColumns(10);
		textField_6.setBounds(100, 181, 86, 20);
		contentPane.add(textField_6);
		
		textField_7 = new JTextField();
		textField_7.setEditable(false);
		textField_7.setColumns(10);
		textField_7.setBounds(100, 205, 86, 20);
		contentPane.add(textField_7);
		
		textField_8 = new JTextField();
		textField_8.setEditable(false);
		textField_8.setColumns(10);
		textField_8.setBounds(100, 230, 86, 20);
		contentPane.add(textField_8);
		
		textField_9 = new JTextField();
		textField_9.setEditable(false);
		textField_9.setColumns(10);
		textField_9.setBounds(100, 254, 86, 20);
		contentPane.add(textField_9);
		
		lblInscriptos = new JLabel("Inscriptos");
		lblInscriptos.setBounds(10, 293, 86, 14);
		contentPane.add(lblInscriptos);
		
		scrollPane = new JScrollPane();
		scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
		scrollPane.setBounds(10, 318, 324, 232);
		contentPane.add(scrollPane);
		
		table = new JTable();
		scrollPane.setViewportView(table);
		table.setModel(new DefaultTableModel(
			new Object[][] {
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
			},
			new String[] {
				"Nombre", "Apellido", "ID"
			}
		) {
			Class[] columnTypes = new Class[] {
				String.class, String.class, String.class
			};
			public Class getColumnClass(int columnIndex) {
				return columnTypes[columnIndex];
			}
			boolean[] columnEditables = new boolean[] {
				false, false, false
			};
			public boolean isCellEditable(int row, int column) {
				return columnEditables[column];
			}
		});
		
		JButton btnSalir = new JButton("Salir");
		btnSalir.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				padre.nullCursadasExaminar();
				dispose();
			}
		});
		btnSalir.setBounds(245, 573, 89, 23);
		contentPane.add(btnSalir);
		table.getColumnModel().getColumn(0).setResizable(false);
		table.getColumnModel().getColumn(1).setResizable(false);
		table.getColumnModel().getColumn(2).setResizable(false);
	}
}
